{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
所有的订单 --  软件代理后台
{% endblock %}
{% block wrapper %}
        <!-- Page wrapper  -->
        <div class="page-wrapper">
            <!-- Bread crumb -->
            <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-primary">查看订单</h3> </div>
                <div class="col-md-7 align-self-center">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{% url "index" %}">主页</a></li>
                        <li class="breadcrumb-item active">查看订单</li>
                    </ol>
                </div>
            </div>
            <!-- End Bread crumb -->
            <!-- Container fluid  -->
            <div class="container-fluid">
                <!-- Start Page Content -->
                <div class="row">
                    <!-- /# column -->
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-title">
                                <h4>目前已完成的订单 </h4>

                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table table-hover ">
                                        <thead>
                                            <tr>
                                                <th>交易时间</th>
                                                <th>交易编号</th>
                                                <th>交易金额</th>
                                                <th>交易备注</th>
                                                <th>查看卡密</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {% if all_deal %}
                                            {% for i in all_deal %}
                                            <tr>
                                                <td>{{ i.time|date:"Y/m/d H:i" }}</td>
                                                <td><span class="badge badge-primary">{{ i.deal_code }}</span></td>
                                                <td>
                                                    {% if i.symbol %}
                                                    +¥{{ i.money }}
                                                    {% else %}
                                                    -¥{{ i.money }}
                                                    {% endif %}
                                                </td>
                                                <td class="color-success">{{ i.notes }}</td>
                                                <td><a href="{% url "check_deal" i.deal_code %}">点击查看</a></td>
                                            </tr>
                                            {% endfor %}
                                        {% else %}
                                            <tr>
                                                <td>暂无订单</td>
                                                <td><span class="badge badge-primary">无</span></td>
                                                <td>¥0</td>
                                                <td class="color-success">请购买卡密</td>
                                                <td><a href="">暂时无法</a></td>
                                            </tr>
                                        {% endif %}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- /# card -->
                    </div>
                    <!-- /# column -->
                </div>
                <!-- /# row -->
                <!-- End PAge Content -->
            </div>
            <!-- End Container fluid  -->
{% endblock wrapper %}